#include <stdio.h>
#include <stdbool.h>

typedef unsigned int u32;
typedef unsigned long long u64;

bool steady(u32 n)
{
    u32 mask = 1;
    for (u32 d = n; d != 0; d /= 10) 
        mask *= 10;
    u64 nl = n;
    return (nl * nl) % mask == nl;
}
 
int main()
{
    for (u32 i = 0; i < 10000000; i++)
        if (steady(i))
	{
	    u64 nl = i;
            printf("%d^2 = %lld\n", i, nl * nl);
	}
    return 0;
}
